![]() |
PBGetCatInfoAsync |
||||
Header: | Files.h | Carbon status: | Supported | |
Gets information about the files and directories in a file catalog.
OSErr PBGetCatInfoAsync ( CInfoPBPtr paramBlock );
A pointer to a catalog information parameter block.
A result code.
The PBGetCatInfoAsync function returns information about a file or directory, depending on the values you specify in the ioFDirIndex, ioNamePtr, ioVRefNum, and ioDirID or ioDrDirID fields. If you need to determine whether the information returned is for a file or a directory, you can test bit 4 of the ioFlAttrib field; if that bit is set, the information returned describes a directory.
The PBGetCatInfoAsync function selects a file or directory according to these rules:
The fields of the parameter block which are used by both files and directories are:
On input, a pointer to a completion function.
On output, the result code of the function.
A pointer to a pathname. For files, the name of the file is returned in this field, if the file is open. If you do not want the name of the file returned, pass NULL in this field.
On input, a volume specification.
On input, an index.
On output, the file or directory attributes. For files, see HFileInfo) for the meaning of the bits in this field.
For directories, the attributes encoded by bits in this field have these meanings
These bits in the ioFlAttrib field for directories are read-only. You cannot alter directory attributes by setting these bits using PBSetCatInfoAsync. Instead, you can call PBHSetFLockAsync and PBHRstFLockAsync to lock and unlock a directory, and PBShareAsync and PBUnshareAsync to enable and disable file sharing on local directories.
For files, these fields of the parameter block are also used:
On output, a file reference number. If the file is open, the reference number of the first access path found is returned here.
On output, information used by the Finder.
On input, a directory ID. On output, the file ID. You might need to save the value of ioDirID before calling PBGetCatInfoAsync if you make subsequent calls with the same parameter block.
On output, the first allocation block of the data fork.
On output, the logical end-of-file of the data fork.
On output, the physical end-of-file of the data fork.
On output, the first allocation block of the resource fork.
On output, the logical end-of-file of the resource fork.
On output, the physical end-of-file of the resource fork.
On output, the date and time of creation.
On output, the date and time of the last modification.
On output, the date and time of the last backup.
On output, additional information used by the Finder.
On output, the directory ID of the parent directory.
On output, the file’s clump size.
For directories, these fields of the parameter block are also used:
On output, the directory access rights. The PBGetCatInfoAsync function returns the directory access rights only for shared volumes. As a result, you should set this field to 0 before calling PBGetCatInfoAsync.
On output, information used by the Finder.
The directory ID.
On output, the number of files in the directory.
On output, the date and time of creation.
On output, the date and time of the last modification.
On output, the date and time of the last backup.
On output, additional information used by the Finder.
On output, the directory ID of the parent directory
With files, PBGetCatInfoAsync is similar to PBHGetFInfoAsync but returns some additional information. With directories, PBGetCatInfoAsync returns information such as the directory attributes and, for server volumes, the directory access privileges of the user.
You can also use PBGetCatInfoAsync to determine whether a file has a file ID reference. The value of the file ID is returned in the ioDirID field. Because that parameter could also represent a directory ID, call PBResolveFileIDRefAsync to see if the value is a real file ID. If you want to determine whether a file ID reference exists for a file and create one if it doesn’t, use PBCreateFileIDRefAsync, which will either create a file ID or return fidExists.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)